package com.idcf.boathouse.product.controller;

import com.idcf.boathouse.product.services.FoodService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @ClassName:CatController
 * @Description:TODO
 * @Author:joyking
 * @Date:2020/12/30 1:24 AM
 * @Version:1.0
 **/
@RestController
@Api(tags = "CAT STAR Test API")
@RequestMapping("/Cat/*")
public class CatController extends BaseController {
    @Autowired
    public FoodService foodService;
    @RequestMapping(value = "CatList", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @ResponseBody
    @ApiOperation("明星猫列表")
    public Map<String, Object> GetCats(@RequestParam(required = false) Integer categoryId){
        List<Map<String, Object>> list = foodService.listFood(categoryId);
        return super.info(BaseController.CODE_OK, "获取明星猫列表成功", list);
    }
}
